home *** CD-ROM | disk | FTP | other *** search
-
- ******************************************************************************
- * *
- * HodgePodge: An example Apple IIGS Desktop application *
- * *
- * Written in 65816 Assembler by the Apple IIGS Tools Team *
- * Modified by Ben Koning for "Programmer's Introduction to the Apple IIGS" *
- * *
- * Copyright (c) 1986-87 by Apple Computer, Inc. *
- * *
- * ---------------------------------------------------------------------- *
- * *
- * ASM65816 Code file "IO.ASM" -- Picture Load and Save stuff calling ProDOS *
- * *
- ******************************************************************************
-
-
-
- ****************************************************************
- *
- * LoadOne
- *
- * Loads the picture whose path name is passed in
- *
- * NamePtr
- *
- * to address passed in
- *
- * PicDestIN
- *
- ****************************************************************
- LoadOne START
- using IOData
-
- _OPEN OpenParams
- bcc cont1
- jmp Error1
-
- cont1 anop
- lda OpenID
- sta ReadID
- sta CloseID
-
- _READ ReadParams
- bcc cont2
- jmp Error1
-
- cont2 anop
- _Close CloseParams
-
- clc
- rts
- end
-
-
- ****************************************************************
- *
- * SaveOne
- *
- * Saves the picture whose path name is passed in
- *
- * NamePtr
- *
- * from address passed in
- *
- * PicDestOUT
- *
- ****************************************************************
- SaveOne START
- using IOData
-
- lda NamePtr
- sta NameC
- sta NameD
- lda NamePtr+2
- sta NameC+2
- sta NameD+2
-
- _Destroy DestParams
-
- lda #$c1 ; SuperHires picture type
- sta CType
- lda #0 ; standard type = 0
- sta CAux
-
- _Create CreateParms
- bcc cont0
- jmp Error1
-
- Cont0 _OPEN OpenParams
- bcc cont1
- jmp Error1
-
- cont1 anop
- lda OpenID
- sta WriteID
- sta CloseID
-
- _WRITE WriteParams
- bcc cont2
- jmp Error1
-
- cont2 anop
- _Close CloseParams
-
- clc
- rts
- end
-
-
-
- ****************************************************************
- *
- * Error1 -- handle disk error during read or write
- *
- ****************************************************************
- Error1 START
- using IOData
- pha
- _Close CloseParams
- pla
- jsr CheckDiskError
- rts
- END
-